<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>excutor</title>
</head>
<body>
    <script>
        let P1 = new Promise((resolve, reject) => {
            /*1.方法一：调用resolve函数，--》PromiseState：fullfilled*/
            resolve("success");
        });
        let P2 = new Promise((resolve, reject) => {
            /*2.方法二：调用reject函数，--》PromiseState：rejected*/
            reject("error");
        });
        let P3 = new Promise((resolve, reject) => {
            /*3.方法三：使用throw关键字抛出错误，--》PromiseState：rejected*/
            throw "it is wrong"
        });
        console.log(P3)
    </script>
</body>
</html>